package com.ganbo.myspring1.controller;


import com.ganbo.myspring1.annotation.GBAutowired;
import com.ganbo.myspring1.annotation.GBController;
import com.ganbo.myspring1.annotation.GBRequestMapping;
import com.ganbo.myspring1.annotation.GBRequestParam;
import com.ganbo.myspring1.service.UserService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@GBController
@GBRequestMapping("/user")
public class UserController {

    @GBAutowired
    UserService userService;

    @GBRequestMapping("/hello")
    public void hello(@GBRequestParam("name") String name, HttpServletRequest request, HttpServletResponse response) throws IOException {
        String str = userService.hello(name);
        response.getWriter().write(str);
    }

}
